<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>activiti页面</title>
<script src="/public/js/jquery-3.3.1.js"></script>
</head>
<body>

<a href="javascript:createModel();">创建model</a>
<a href="javascript:jumpActiviti();">请求modeler页面</a>
<a href="javascript:bushu();">发布部署流程</a>
<br>
<input id="taskName" value="">
<br>
<input id="taskId" value="">
<br>
<a href="javascript:startProcess();">启动流程并查看任务</a>
<br>
<a href="javascript:completeTask();">质检分单</a>
<a href="javascript:completeTaskss();">质检继续流程</a>

<!--  <br>
<img src="/modeler/22550/0/showModelGLPicture"/>
<br>
<img src="/modeler/22550/1/showModelGLPicture"/>  -->
 <br>
<img src="/modeler/22543/0/showModelGLTaskPicture"/>
<br>
<img src="/modeler/50072/1/showModelGLTaskPicture"/>
<!-- <br>
<img src="/modeler/1/showModelPicture"/>   -->


<script type="text/javascript">

	var modelId;

	function createModel(){
		$.ajax({
		    url: '/modeler/newModel',
		    type: 'get',
		    success: function (data) {
		    	alert(JSON.stringify(data));
		    	if(data.code == "000"){
		    		modelId = data.data;
		    	}

		    }
		});
	}

	function jumpActiviti(){
		 window.open('/public/modeler/modeler.html?modelId='+1);
	}

	function bushu(){
		$.ajax({
		    url: '/modeler/'+1+'/deployment',
		    type: 'post',
		    success: function (data) {
		    	alert(JSON.stringify(data));
		    }
		});
	}

	function startProcess(){
		$.ajax({
		    url: '/modeler/'+1+'/startProcess',
		    type: 'post',
		    success: function (data) {
		    	$("#taskName").val(data.data.name)
		    	$("#taskId").val(data.data.id)
		    }
		});
	}

	function completeTask(){
		var taskId = $("#taskId").val();
		$.ajax({
		    url: '/modeler/'+taskId+'/fendan',
		    type: 'post',
		    success: function (data) {
		    	alert(JSON.stringify(data));
		    	$("#taskName").val(data.data[0].name)
		    	$("#taskId").val(data.data[0].id)
		    }
		});
	}

	function completeTaskss(){
		var taskId = $("#taskId").val();
		$.ajax({
		    url: '/modeler/'+2552+'/ssTask',
		    type: 'post',
		    success: function (data) {
		    	alert(JSON.stringify(data));
		    	$("#taskName").val(data.data[0].name)
		    	$("#taskId").val(data.data[0].id)
		    }
		});
	}
	
</script>
</body>
</html>